import React, { Component } from 'react'

import {getDatas} from '../../../utils/tools';
import {COURSE_TH} from '../../../config/table_config';

import CourseService from '../../../services/course';

import ListTitle from '../../../components/common/ListTitle';
import TableTh from '../../../components/common/TableTh'

import './index.scss'

const courseService = new CourseService();

export default class Course extends Component {
    constructor(props){
        super(props);
        this.state={
            title:'课程管理',
            thData:'',

        }
    }
    onRefreshData(){
       
    }
    async getCourseData(){
        const result = await courseService.getCourseData(),
              errorCode = result.error_code,
              data = result.data,
              {history} = this.props;
              
              getDatas(errorCode,data,history,()=>{

                 this.setState({
                     thData : data
                 })
                
              })
             
    }
    componentDidMount(){
        this.getCourseData()
    }
    render() {
        const {title,thData} = this.state;
        console.log(1,this.state.thData);
        return (
            <div className="list-container">
               <ListTitle title={title}></ListTitle>
               {/* <TableTh thData={1 onRefreshData={this.getCourseData.bind(this)} ></TableTh> */}
            </div>
        )
    }
}
